package mjc.egg;
import mjc.tds.*;
import mjc.type.*;
import mjc.gc.*;
import mjc.compiler.*;
import java.util.*;
import mg.egg.eggc.compiler.libjava.lex.*;
import mg.egg.eggc.compiler.libjava.*;
import mg.egg.eggc.compiler.libjava.problem.IProblem;
import java.util.Vector;
import java.util.List;
import java.util.ArrayList;
public class S_OPREL_MJAVA implements IDstNode {
LEX_MJAVA scanner;
  S_OPREL_MJAVA() {
    }
  S_OPREL_MJAVA(LEX_MJAVA scanner) {
    this.scanner = scanner;
    offset = 0;
    length = 0;
    this.att_scanner = scanner;
    }
int [] sync= new int[0];
  String att_operateur;
  LEX_MJAVA att_scanner;
  private void regle45() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_sup);
      addChild(x_2);
      action_op3_45();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle47() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_eg);
      addChild(x_2);
      action_op5_47();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle44() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_infeg);
      addChild(x_2);
      action_op2_44();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle46() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_supeg);
      addChild(x_2);
      action_op4_46();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle43() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_inf);
      addChild(x_2);
      action_op1_43();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
  private void regle48() throws Exception {
 offset = scanner.getOffset(0);

    //declaration
    T_MJAVA x_2 = new T_MJAVA(scanner ) ;
    //appel
    x_2.analyser(LEX_MJAVA.token_neg);
      addChild(x_2);
      action_op6_48();
     length =x_2.getOffset() + x_2.getLength()  -offset;
  }
private void action_op3_45() throws Exception {
try {
// instructions
this.att_operateur="sup";
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_op2_44() throws Exception {
try {
// instructions
this.att_operateur="infeg";
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_op5_47() throws Exception {
try {
// instructions
this.att_operateur="eg";
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_op1_43() throws Exception {
try {
// instructions
this.att_operateur="inf";
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_op4_46() throws Exception {
try {
// instructions
this.att_operateur="supeg";
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
private void action_op6_48() throws Exception {
try {
// instructions
this.att_operateur="neg";
}catch(RuntimeException e) {		//e.printStackTrace();
	}
  }
  public void analyser () throws Exception {
    scanner.lit ( 1 ) ;
    switch ( scanner.fenetre[0].code ) {
      case LEX_MJAVA.token_inf : // 45471
        regle43 () ;
      break ;
      case LEX_MJAVA.token_infeg : // 45472
        regle44 () ;
      break ;
      case LEX_MJAVA.token_sup : // 45473
        regle45 () ;
      break ;
      case LEX_MJAVA.token_supeg : // 45474
        regle46 () ;
      break ;
      case LEX_MJAVA.token_eg : // 45475
        regle47 () ;
      break ;
      case LEX_MJAVA.token_neg : // 45476
        regle48 () ;
      break ;
      default :
               scanner._interrompre(IProblem.Syntax, scanner.getBeginLine(), IMJAVAMessages.id_MJAVA_unexpected_token,MJAVAMessages.MJAVA_unexpected_token,new String[]{scanner.fenetre[0].getNom()});
    }
  }
    private IDstNode parent;
    public void setParent( IDstNode p){parent = p;}
    public IDstNode getParent(){return parent;}
    private List<IDstNode> children = null ;
    public void addChild(IDstNode node){
      if (children == null) {
         children = new ArrayList<IDstNode>() ;}
      children.add(node);
      node.setParent(this);
    }
    public List<IDstNode> getChildren(){return children;}
    public boolean isLeaf(){return children == null;}
    public void accept(IDstVisitor visitor) {
      boolean visitChildren = visitor.visit(this);
      if (visitChildren && children != null){
        for(IDstNode node : children){
          node.accept(visitor);
        }
    }
    visitor.endVisit(this);
  }
  private int offset;
  private int length;
  public int getOffset(){return offset;}
  public void setOffset(int o){offset = o;}
  public int getLength(){return length;}
  public void setLength(int l){length = l;}
  private boolean malformed = false;
  public void setMalformed(){malformed = true;}
  public boolean isMalformed(){return malformed;}
  }
